package xjh.him.bean;

import android.text.SpannableString;

import java.io.Serializable;

import lombok.Data;
import xjh.him.common.SharedData;

@Data
public class ChatBean implements Serializable {
    Integer userId;
    String fileUrl;
    SpannableString text;
    boolean isLeft;
    Byte type;

    public ChatBean(Integer userId, String fileUrl, SpannableString text, boolean isLeft, Byte type) {
        this.userId = userId;
        this.fileUrl = fileUrl;
        this.text = text;
        this.isLeft = isLeft;
        this.type = type;

        if (this.type == SharedData.CHAT_MSG_TYPE_TEXT) {
            this.fileUrl = "";
        }else {
            if (!"".equals(this.fileUrl))
                this.text = null;
        }
    }
}
